package task;

import java.util.Arrays;

public class 冒泡作业 {
    public static void main(String[] args) {
        //静态初始化一维数组{10,20,11,35,6,89}，进行冒泡排序
        int[] arr={10,20,11,35,6,89};
        int temp=0;
        for (int i = 0; i <arr.length-1 ; i++) {//轮
            for (int j = i+1; j <arr.length ; j++) {//每轮几次
                if (arr[i]>arr[j]){
                    temp=arr[i];
                    arr[i]=arr[j];
                    arr[j]=temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
